﻿<Page
    x:Class="Caliburn.Micro.WinRT.Sample.Views.CoroutineView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Button x:Name="GoBack" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock Text="Coroutines" Style="{StaticResource PageHeaderTextStyle}" Grid.Column="1" />
        </Grid>

        <Grid Grid.Row="1" Margin="120,0,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="400" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <TextBlock x:Uid="CoroutinesExplanation" Style="{StaticResource ExplanationTextStyle}" />

            <StackPanel Grid.Column="1">
                <Button x:Name="Execute" Content="Execute Coroutine"/>
            </StackPanel>

            <ProgressRing x:Name="LoadingIndicator" Foreground="{StaticResource MetroOrangeBrush}" Grid.ColumnSpan="3"
                          Width="60" Height="60" IsActive="False" HorizontalAlignment="Center" VerticalAlignment="Center" />

        </Grid>

        <Image Style="{StaticResource MarkerMetroLogo}" Grid.Row="1"/>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="Loading">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LoadingIndicator" Storyboard.TargetProperty="IsActive">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="LoadingComplete" />
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>